package com.easylinkin.linkappapi.deviceservice.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.easylinkin.linkappapi.device.entity.Device;
import com.easylinkin.linkappapi.deviceparm.entity.DeviceParm;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 *
 * </p>
 *
 * @author TongJie
 * @since 2020-04-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel("设备服务实体类")
@TableName("linkapp_device_service")
public class DeviceServices extends Model<DeviceServices> {

    private static final long serialVersionUID = 1L;

    @TableId("id")
    @ApiModelProperty("主键ID")
    private String id;

    @ApiModelProperty("设备型号ID")
    @TableField("device_unit_id")
    private String deviceUnitId;

    @ApiModelProperty("设备服务定义")
    @TableField("identifier")
    private String identifier;

    @ApiModelProperty("设备服务名称")
    @TableField("name")
    private String name;
    /**
     * 确认信号超时时间 s
     */
    @ApiModelProperty(value = "确认信号超时时间", required = false, example = "1")
    @TableField("ack_time_out")
    private Integer ackTimeOut;    
    
    /**
     * 确认信号类型 0-无应答 1-异步应答 2-同步应答
     */
    @ApiModelProperty(value = "确认信号类型", required = false, example = "1")
    @TableField("ack_type")
    private Integer ackType;

    @ApiModelProperty(value = "类型", required = false, example = "0")
    @TableField("type")
    private Integer type;

    @ApiModelProperty(value = "排序号", required = false, example = "0")
    @TableField("sort_no")
    private Integer sortNo;

    @ApiModelProperty("版本号")
    @TableField("version")
    private String version;

    @ApiModelProperty("是否展示")
    @TableField("is_show")
    private Boolean isShow;

    @ApiModelProperty("创建时间")
    @TableField("create_time")
    private Date createTime;

    @ApiModelProperty("创建人")
    @TableField("creator")
    private String creator;

    @ApiModelProperty("修改人")
    @TableField("modifier")
    private String modifier;

    @ApiModelProperty("修改时间")
    @TableField("modify_time")
    private Date modifyTime;

    @ApiModelProperty("设备参数集合")
    @TableField(exist = false)
    private List<DeviceParm> paramList;

    @ApiModelProperty("设备")
    @TableField(exist = false)
    private Device device;
    
    /**
     * 租户id查询用
     */
    @ApiModelProperty("租户ID")
    @TableField(exist = false)
    private String tenantId;

    @TableField(exist = false)
    @ApiModelProperty("下发参数")
    private Map<String, Object> downParameter;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
